DelegateCommand

Ecng.ComponentModel

Delegate command capable of taking argument.

継承元: Disposable

実装: IRevalidatableCommand, ICommand

コンストラクター

DelegateCommand
public DelegateCommand(Action<T> execute, Func<T, bool> canExecute)
delegateCommand = DelegateCommand(execute, canExecute)

Creates a new command with conditional execution.

execute
The execution logic.
canExecute
The execution status logic.

メソッド

CanExecute
public bool CanExecute(object parameter)
result = delegateCommand.CanExecute(parameter)
DisposeManaged
protected override void DisposeManaged()
delegateCommand.DisposeManaged()

Disposes the managed resources. Override this method to add custom clean up of managed resources.

Execute
public void Execute(object parameter)
delegateCommand.Execute(parameter)
RaiseCanExecuteChanged
public void RaiseCanExecuteChanged()
delegateCommand.RaiseCanExecuteChanged()

Invoke CanExecuteChanged event.

イベント

CanExecuteChanged
public event EventHandler CanExecuteChanged
delegateCommand.CanExecuteChanged += handler